import { eventHandler, readBody } from 'h3';

export default eventHandler(async (event) => {
  const { password, username } = await readBody(event);
  const access_token = generateAccessToken({
    username,
    password,
  });
  const refresh_token = generateRefreshToken({
    username,
    password,
  });
  return useResponseSuccess({
    userId: 1,
    access_token,
    access_expire: 1_755_222_609,
    refresh_token,
    refresh_expire: 1_760_320_209,
  });
});
